Skip to content

Conversation

@michalmarczyk
Copy link
Member

This makes the names of several built-ins (e.g. clojure.core/{<,>,=})
legal symbols.

This makes the names of several built-ins (e.g. clojure.core/{<,>,=})
legal symbols.
@michalmarczyk
Copy link
Member Author

Admittedly the patch doesn't exactly nail down a precise symbol/keyword literal spec and the reader has always been more permissive than the spec promises when it comes to symbols/keywords, but these characters are so common in actual symbols, including in clojure.core and core.async, that they may be worth adding.

I think it might be nice to also add #, partly because of syntax-quote and partly because of a desire to make Hiccup-style keywords like :dev#foo officially legal.

On the subject of syntax-quote: the syntax-quote section of the reader spec says "If a symbol is non-namespace-qualified and ends with '#'", suggesting a conceptual approach where an auto-gensym is first read as a symbol containing # and then transformed, which is of course the case in implementation terms as well. For this conceptualization to work, # should be a valid constituent character in symbol literals, however.

This would be a somewhat bigger change, though, because (1) one might want to make symbol-initial # illegal because of the clash with tagged/ctor literals while still admitting it in keywords (to support Hiccup's :#foo), (2) one would probably want to add a reference to the syntax-quote section. So, leaving this out for now, though I'd be happy to draft a change along these lines in a separate PR if that'd be helpful.

@puredanger
Copy link
Member

FYI, this is likely to sit for an arbitrary amount of time before Rich can weigh in on it. In the past he has not been eager to expand the explicit set (and I don't know that he considers the rules to necessarily be the same for core or core.async as for external libs).

@iku000888
Copy link
Contributor

iku000888 commented Jan 19, 2017

Randomly pasting an ancient thread on a relevant topic:
https://groups.google.com/forum/#!msg/clojure/VP_ohwqJRns/UPGUA8fdgn4J;context-place=forum/clojure

@puredanger
Copy link
Member

Rich ok'ed

@puredanger puredanger merged commit be3ae06 into clojure:master Dec 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants